﻿using System.Linq.Expressions;
using System;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;

namespace Utils.JobTask
{
    public interface IJobProvider
    {

        void Run(JobTaskBuilder jobBuilder);
        IJobService<E> GetJob<E>();

    }
    public interface IJobService<E>
    {
        void Execute(int countdown, Expression<Func<E, Action>> expression);
        void Execute<T>(int countdown, Expression<Func<E, Action<T>>> expression, T arg);
        void Execute<T, T2>(int countdown, Expression<Func<E, Action<T, T2>>> expression, T arg, T2 arg2);
        void Execute<T, T2, T3>(int countdown, Expression<Func<E, Action<T, T2, T3>>> expression, T arg, T2 arg2, T3 arg3);

        void Execute<T, T2, T3, T4>(int countdown, Expression<Func<E, Action<T, T2, T3, T4>>> expression, T arg, T2 arg2, T3 arg3, T4 arg4);
        void Execute(int countdown, Expression<Func<E, Func<Task>>> expression);
        void Execute<T>(int countdown, Expression<Func<E, Func<T, Task>>> expression, T arg);
        void Execute<T, T2>(int countdown, Expression<Func<E, Func<T, T2, Task>>> expression, T arg, T2 arg2);
        void Execute<T, T2, T3>(int countdown, Expression<Func<E, Func<T, T2, T3, Task>>> expression, T arg, T2 arg2, T3 arg3);

        void Execute<T, T2, T3, T4>(int countdown, Expression<Func<E, Func<T, T2, T3, T4, Task>>> expression, T arg, T2 arg2, T3 arg3, T4 arg4);
    }
}
